import { useRouter } from "vue-router";
import { onBeforeMount } from "vue";
import getInstance from "@/components/PublicProcess/utils/proxyToken.js";
export default function useSetToken() {
  onBeforeMount(() => {
    const router = useRouter();
    const params = router.currentRoute.value.query;
    const Authorization = params["Authorization"];
    if (Authorization) {
      const instance = getInstance();
      instance.setToken((Authorization as string).substring(7));
    }
  });
}
